package com.lanhu.designpattern.delegation.student;

import java.util.HashMap;
import java.util.Map;

/**
 * author:zhangzg
 * date:2020/11/9 15:08
 */
public class ClassMonitor {
    private Map<String, Student> map = new HashMap<>();


    public ClassMonitor() {
        map.put("学习", new StudentA());
        map.put("体育", new StudentB());
    }

    public void dispatcher(String thing){
        map.get(thing).doing(thing);
    }
}
